//
//  PersonalViewController.m
//  shike
//
//  Created by RegentSoft on 2017/4/19.
//  Copyright © 2017年 RegentSoft. All rights reserved.
//

#import "PersonalViewController.h"
#import "PersonalTableViewCell.h"
@interface PersonalViewController ()<UITableViewDelegate,UITableViewDataSource>{


}
@property(nonatomic ,strong)UITableView * personalTabView;
@end
@implementation PersonalViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //导航栏的标题颜色字体
    self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"" style:UIBarButtonItemStylePlain target:nil action:nil];
    self.navigationController.navigationBar.tintColor = [UIColor colorWithHexString:@"#999999"];
    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName :[UIColor colorWithHexString:@"#323232"],NSFontAttributeName :[UIFont systemFontOfSize:16.0]}];
    self.title = @"我的";
    self.view.backgroundColor = [UIColor colorWithHexString:@"#F0F0F5"];
    _personalTabView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height-44) style:UITableViewStylePlain];
    _personalTabView.delegate = self;
    _personalTabView.dataSource = self;
    [self.view addSubview:_personalTabView];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 5;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 70;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    static NSString * cellIdenifer =@"cellIdenifer";
    PersonalTableViewCell * cell =[tableView dequeueReusableCellWithIdentifier:cellIdenifer];
    if (!cell) {
        cell =[[PersonalTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdenifer];
    }
    cell.headImage.image = [UIImage imageNamed:@""];
    cell.titleLabel.text = @"1234";
    cell.contentLabel.text = @"d8dd8152143711e7a393a45e60ce3abd";
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
}
-(void)httpRequest{
    NSMutableDictionary * dic = [[NSMutableDictionary alloc] init];
    [dic setObject:@"d8dd8152143711e7a393a45e60ce3abd" forKey:@"tenantId"];
    [dic setObject:@"onebook" forKey:@"name"];
    [self loadProgressViewIsShow:YES];
    [[RSNetworkManager sharedManager] POST:@"http://120.77.252.204/api/book/create" parameters:dic progress:^(NSProgress * _Nonnull uploadProgress) {
    } success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        NSDictionary * dic = [NSJSONSerialization JSONObjectWithData:responseObject options:NSJSONReadingAllowFragments error:nil];
        NSLog(@"1111====%@",dic);
        [self loadProgressViewIsShow:NO];
        [self showLoadProgressViewWithMessage:@"获取返回数据异常" delay:3.0];
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        NSLog(@"1111====%ld",(long)error.code);
        NSLog(@"1111====%ld",(long)error.userInfo);
    }];
}

@end
